package casa.depesos.app.com.http.data;

import android.text.TextUtils;

import androidx.annotation.NonNull;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class Name {

    @SerializedName("paterName")
    @Expose
    public String father;

    @SerializedName("stype")
    @Expose
    public String sex;

    @SerializedName("mobcon")
    @Expose
    public String phone;

    @NonNull
    @Override
    public String toString() {
        if (TextUtils.isEmpty(father)) {
            return phone;
        }
        if ("f".equalsIgnoreCase(sex)) {//woman
            return "Sra. " + father;
        } else {//man
            return "Sr. " + father;
        }
    }

    public boolean isFemale() {
        return "f".equalsIgnoreCase(sex);
    }
}
